var pathName = window.document.location.pathname;
				// 截取，得到项目名称
var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);


//删除评估列表
function delUsertail(usertailid){
	layer.open({
        content : "是否删除该条信息!",
        icon:3,
        btn : ['是','否'],
        yes : function(){
        	var url = projectName+"/wxUserdetailAction_deleteWxUserdetail?usertailid="+usertailid;
            $.post(url,function(data){
            	if(data == 0){
            		showDialogsucur2("删除失败");
            	}else{
            		return location.reload(); 
            	}	
            });
        },
	});
}






//新增家庭成员
//var trAppend = '<tr><td><select name="familytypes"><c:forEach items="${familytypes }" var="familytype" varStatus="st"><c:if test="${st.index gt 0 }"><option value="${st.index }">${familytype}</option></c:if></c:forEach><lect></td><td><input type="text" name="ages" /></td><td><select name="healthtypes"><option value="1">健康</option><option value="2">生病</option><lect></td><td><select name="hasattends"><option value="1">是</option><option value="2">否</option><lect><td><select name="hasotherattends"><option value="1">有</option><option value="2">无</optio<lect></td><td><a href="javascript:void(0)" id="crime-delete"><span class="glyphicon glyphicon-remove-circle" aria-hidden="true"></span></a></td></tr>';
/*var index = 0;
var length = 0;
$('.familyInfo-add-title .icon').click(function() {
    index++;
    length = $('.table-responsive').find('tr').length;
    $('.familyInfo-add-title tbody').append(trAppend);
    $('.table-responsive').find('tr').eq(length).attr('class','index'+index);
    $('.table-responsive').find('tr').eq(length).find('td select').attr('name','wxFamilyinfoList['+index+'].familytype');
    $('.table-responsive').find('tr').eq(length).find('td input').attr('name','wxFamilyinfoList['+index+'].familytype');
    // console.log($('.familyInfo-add-title tbody tr:eq(0) td input').val());
    // console.log($('.familyInfo-add-title tbody tr:eq(0) td:eq(0) select option:checked').text());
})*/
$(document).on('click','#record-delete', function() {
    // $(this).parents('tr').attr('class');
    $(this).parents('tr').remove();
    /*length--;
    newIndex = $('.table-responsive tbody tr:last-child').attr('class');
    console.log(newIndex.length);
    if(newIndex.length > 6) {
        index = newIndex.substr(newIndex.length-2,2);
    }else{
        index = newIndex.substr(newIndex.length-1,1);
    }*/
})

// 未婚已婚选择
$('.married-item1').click(function() {
    $(this).siblings().find('label').removeClass('checked');
    $(this).find('label').addClass('checked');
    var id = $(this).find('label').data('id');
	$('.familyInfo-married').find('input').val(id);
	var pk = $('.familyInfo-married').find('input').val();
	console.log(pk);
})

//下一步
$('.record-body-next1').click(function() {
	var username = $('.personInfo-name input').val();
	if(username === "") {
		showDialog('姓名不能为空！');
		return false;
	}
    $('.panel-body-one').hide();
    $('.panel-body-two').show();
    $('.record-add-page').animate({scrollTop:0},10);
})

//返回
$('.record-body-return2').click(function() {
    $('.panel-body-two').hide()
    $('.panel-body-one').show();
    $('.record-add-page').animate({scrollTop:0},10);
})

$('.record-body-return3').click(function() {
    $('.panel-body-three').hide()
    $('.panel-body-two').show();
    $('.record-add-page').animate({scrollTop:0},10);
})
$('.crime-msk-close').click(function() {
    $('.crime-msk').fadeOut(400);
})
$('.crime-msk-cancel').click(function() {
    $('.crime-msk').fadeOut(400);
})